package edu.lingnan.rili.pojo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.format.NumberFormat;
import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import edu.lingnan.rili.converter.LocalDateTimeConverter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.beans.factory.annotation.Value;

/**
 * <p>
 * 
 * </p>
 *
 * @author 陈世杰
 * @since 2022-01-23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tb_marks")
@ApiModel("加分减分实体类")
public class Marks implements Serializable {
    public static final String DEFAULT_ANNOUNCEMENT = "0";
    public static final String NOT_ANNOUNCED = "0";
    public static final String ANNOUNCED = "1";

    private static final long serialVersionUID = 1L;

    @ExcelProperty(value = "分数", index = 5)
    @NumberFormat("##.00")
    @ApiModelProperty("加减分数")
    private Double addScore;

    @ExcelProperty(value = "类型", index = 6)
    @ApiModelProperty("加减分类型")
    private String addType;

    @ExcelProperty(value = "原因", index = 7)
    @ApiModelProperty("加减分原因")
    private String addCause;

    @ExcelProperty(value = "时间", index = 8, converter = LocalDateTimeConverter.class)
    // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("加减分时间")
    private LocalDateTime addTime;

    @ExcelIgnore
    @ApiModelProperty("公示情况，0为未公示，1为公示，默认未公示")
    @Value(DEFAULT_ANNOUNCEMENT)
    private String pubblicityType;

    @ExcelIgnore
    @ApiModelProperty("参考学号")
    private String usersId;

    // @ApiModelProperty("加减分学生信息")
    // @ExcelIgnore
    // private Match match;
}
